#define   osObjectsPublic                                       // define objects in rtxapp module
#include "osObjects.h"                                          // RTOS object definitions
#include "systimer.h"

/*----------------------------------------------------------------------------
 *      Thread 1 'Thread_Name': Sample thread
 *---------------------------------------------------------------------------*/
 
//void Thread (void const *argument);                             // thread function
//osThreadId tid_Thread;                                          // thread id
//osThreadDef (Thread, osPriorityNormal, 1, 0);                   // thread object

int Init_Thread (void)
{
  /*
  tid_WifiTask = osThreadCreate (osThread(WifiTask), NULL);
  if (!tid_WifiTask) return(-1);
  */

  tid_ComTask = osThreadCreate (osThread(ComTask), NULL);
  if (!tid_ComTask) return(-1);

  tid_Modbus = osThreadCreate (osThread(Modbus), NULL);
  if (!tid_Modbus) return(-1);	

  tid_PrintTask = osThreadCreate (osThread(PrintTask), NULL);
  if (!tid_PrintTask) return(-1);	

  tid_Thread = osThreadCreate (osThread(Thread), NULL);
  if (!tid_Thread) return(-1);	

  return(0);
}

void Thread (void const *argument)
{

  while (1)
  {
    //osSignalSet (tid_Modbus ,  0x01);
	osDelay(10);
    SysTickCnt++;
  }
}

